package mathive.server.persistant;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class SessionID {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
    private String sessionID;
	
	@Persistent
    private Key userkey;
	
	@Persistent
    private Date created;
	
	public SessionID(String sessionID, Key userkey) {
		this.sessionID = sessionID;
		this.userkey = userkey;
		this.created = new Date();
    }
    
    public Key getKey() {
        return key;
    }
    
    public Key getUserKey() {
        return userkey;
    }
    
    public String getSessionID() {
        return sessionID;
    }
    
    public Date getDateCreated() {
        return created;
    }
}
